home *** CD-ROM | disk | FTP | other *** search
- Path: news.deltanet.com!usenet
- From: olivas@deltanet.com (Sergio Olivas)
- Newsgroups: comp.lang.c++
- Subject: Re: Template Class Linkage?
- Date: Mon, 08 Jan 1996 03:53:21 GMT
- Organization: Delta Internet Services, Anaheim, CA
- Message-ID: <4cq4hs$raa@news2.deltanet.com>
- References: <4cmnjs$mk7@mimsy.cs.umd.edu>
- NNTP-Posting-Host: ana0002.deltanet.com
- X-Newsreader: Forte Free Agent 1.0.82
-
-
- >I'm just learning templates, and I'm having problems with linkage.
- >When the template class member function bodies are included in the ".h" file,
- >everything is fine. But when the function bodies are in a separate ".c" file,
- >calls to these functions from other files give an "undefined reference to
- >function" error from the linker. Do template class member functions have
- >to be in the ".h" file, or is this a problem with my compiler?
-
- Yes, this is a known 'feature' of C++ -- As far as the language
- standard and all the compilers go. I understand an update to the C++
- language will include some way of including the template stuff into
- the .c (cpp) files, as well as provide the Standard Template library
- as part of the language.
-
- later,
- sergio
-
-
-